package com.yuguoxy.mytomcat;

/**
 * 所有servlet父类
 * doget
 * doPost
 * service
 */
public abstract class YGHttpServlet {
    public abstract void doGet(YGHttpRequest request,YGHttpResponse response);
    public abstract void doPost(YGHttpRequest request,YGHttpResponse response);

    public void service(YGHttpRequest request,YGHttpResponse response){
        if(request.getMethod().equalsIgnoreCase("POST")){
            doPost(request,response);
        }else if(request.getMethod().equalsIgnoreCase("GET")){
            doGet(request,response);
        }
    }
}
